//package com.zrrd.yunchmall.order.controller;
//
//import com.alibaba.csp.sentinel.annotation.SentinelResource;
//import com.zrrd.yunchmall.order.service.OrderServiceImpl;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.Mapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.Random;
//
///**
// * @author yekong
// */
//@SuppressWarnings("all")
//@RestController
//@Slf4j
//public class Ordercontroller2 {
//
//    @Autowired
//    private OrderServiceImpl orderService;
//
//    //http://localhost:8081/order/message/m1
//    @RequestMapping("/order/m1")
//    public String message1() throws InterruptedException {
////        Random random = new Random();
////        if (random.nextInt(10000) % 4 == 0) {
////            throw new RuntimeException("程序出现错误");
////       }
////        if (random.nextBoolean()) {
////            //一半的请求都会超时100ms
////            Thread.sleep(500);
////        }
////        return "message1";
//        return orderService.message(1);
//    }
//
//    @RequestMapping("/order/m2")
//    public String message2() {
////        return "message2";
//        return orderService.message(2);
//    }
//
//    @RequestMapping("/order/m3")
//    //热点规则的资源需要使用@SentinelResource定义
//    @SentinelResource("M3")
//    public String message3(String name, int age) {
//        return "名字：" + name + "， 年龄：" + age;
////        return "message3";
////        return orderService.message(3);
//    }
//}
